 <?php
	require_once('db_connect.php');
	
	$user_id = $_GET['user_id'];
	$query = "select * from preset where user_id='$user_id'";
	$data = mysqli_query($conn, $query)
		or die('category 가져오는 쿼리 실패');

	if (mysqli_num_rows($data) > 0) {
		$row = mysqli_fetch_array($data);
		echo json_encode(array('bus_numbers' => $row['bus_numbers'],
								'facebook_id' => $row['facebook_id'],
								'crime_rate' => doubleval($row['crime_rate'])));
	}
	else {
		echo json_encode(array('error' => 'error'));
	}
	mysqli_close($conn);
	exit;
 ?>